package com.bowen.cbs.web;

import com.bowen.cbs.common.FrontEndLogFile;
import com.bowen.cbs.vo.FileLogVO;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * 日志查询Controller
 * 公众号【猿码天地】
 */
@RestController
@RequestMapping("/frontend")
public class FrontEndMonitorController {

	@RequestMapping(value = {"/log"}, method = RequestMethod.POST, produces= MediaType.APPLICATION_JSON_UTF8_VALUE)
	@ResponseBody
	public String frontendLog(@RequestBody FileLogVO fileLogVO, HttpServletRequest request) {
		if(null == fileLogVO){
			return "参数错误";
		}
		return FrontEndLogFile.readFile(fileLogVO);
	}

}